//弹框
export const toggle = {
    data() {
        return {
            // 1.初始化弹框出现的状态
            info: {
                isshow: false,
                isAdd: true,
            },
        }
    },
    methods: {
        // 2.点了添加
        willAdd() {
            this.info.isshow = true;
            this.info.isAdd = true;
        },
        // 7.点了编辑
        willUpdate(id) {
            this.info.isshow = true;
            this.info.isAdd = false;
            // 让form调用发请求
            this.$refs.form.getOne(id)
        },
    }
}

//form 关闭弹框
export const formClose = {
    methods: {
        // 10.关闭弹框
        close() {
            if (!this.info.isAdd) {
                this.empty();
            }
        },// 8.取消
        cancel() {
            this.info.isshow = false;
        },
    }
}